<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<script type="text/javascript">
	function openNewWindow(url){
		window.open(url);
	}
</script>
<div class="easyui-layout" fit="true">
	<div region="center" style="padding:1px;">
		<t:datagrid name="enterList" title="单位用户"
			actionUrl="enterController.do?datagrid" idField="id" fit="true"
			queryMode="group">
			<t:dgCol title="编号" field="id" hidden="false"></t:dgCol>
			<t:dgCol title="单位帐号" field="account" width="100" query="true"></t:dgCol>
			<t:dgCol title="单位名称" field="name" width="200" query="true" ></t:dgCol>
			<t:dgCol title="执行频率" field="zxpl" width="100" dictionary="timecron"></t:dgCol>
			<t:dgCol title="操作" field="opt" width="400"></t:dgCol>
			<t:dgFunOpt funname="keywordTypeManage(id)" title="关键词类型" />
			<t:dgFunOpt funname="leftkeywordManage(id)" title="关键词管理" />
			<t:dgFunOpt funname="resetpwd(id)" title="重置密码" />
			<t:dgDelOpt title="删除" url="enterController.do?del&id={id}" />
			<t:dgToolBar title="录入" icon="icon-add"
				url="enterController.do?addorupdate" funname="add"></t:dgToolBar>
			<t:dgToolBar title="编辑" icon="icon-edit"
				url="enterController.do?addorupdate" funname="update"></t:dgToolBar>
			<t:dgToolBar title="查看" icon="icon-search"
				url="enterController.do?addorupdate" funname="detail"></t:dgToolBar>
		</t:datagrid>
	</div>
	<div region="east" split="true" style="width: 350px;">
		<div tools="#tt" class="easyui-panel" 
			 style="padding: 10px;" fit="true" border="false"  id="enter_panel">
		</div>
	</div>
</div>

<script>

	function toMessManage(id){
		var title = "消息管理";	
		var url = "messageController.do?message&qyid="+id
		$.dialog({
			content: 'url:'+url,
			title : title,
			cache:false,
			lock : true,
			width: 1000,
		    height: 500,
		    zIndex: 200,
		    cancelVal: '关闭',
		    cancel: true /*为true等价于function(){}*/
		});

	}

	function tokeyinfoList(id){
		var title = "补充信息";	
		var url = "keyinfoController.do?keyinfo&qyid="+id;	
		$.dialog({
			content: 'url:'+url,
			title : title,
			cache:false,
			lock : true,
			width: 1000,
		    height: 500,
		    zIndex:200,
		    cancelVal: '关闭',
		    cancel: true /*为true等价于function(){}*/
		});
	}

	function resetpwd(id){
		var url = "enterController.do?resetpwd&id="+id;
		createwindow("重置密码",url);
	}
	
	function keywordTypeManage(id){
		var url = "keywordTypeController.do?keywordType&qyid="+id;
		$("#enter_panel").panel(
			{
				title : "关键词类型"
			}
		);
		$('#enter_panel').panel("refresh", url);
	}
	
	function leftkeywordManage(id){ 
		var url = "keywordController.do?keywordlist&qyid="+id;
		$("#enter_panel").panel(
			{
				title : "关键词"
			}
		);
		$('#enter_panel').panel("refresh", url);
	}

	function keywordManage(id){ 
		var title = "分配关键词";	
		var url = "keywordController.do?toAssignKeyword&id="+id;			
		$.dialog({
			content: 'url:'+url,
			title : title,
			cache:false,
			lock : true,
			width: 800,
		    height: 500,
		    cancelVal: '关闭',
		    cancel: true /*为true等价于function(){}*/
		});
 	}

	function uploadEnterTop(id){
		var url = "enterController.do?uploadpic&id="+id+"&type=top";
		createwindow("首页顶部照片",url);
	}
	
	function uploadEnterBottom(id){
		var url = "enterController.do?uploadpic&id="+id+"&type=bottom";
		createwindow("首页底部照片",url);
	}
</script>

<script>
	function keywordSite(id){ 
		var title = "分配站点";	
		var url = "siteController.do?toAssignSite&keywordid="+id;			
		$.dialog({
			content: 'url:'+url,
			title : title,
			cache:false,
			lock : true,
			width: 800,
		    height: 500,
		    cancelVal: '关闭',
		    cancel: true /*为true等价于function(){}*/
		});
	}